package com.tfjybj.itoo.exam.provider.service.impl;

import com.dmsdbj.itoo.tool.base.service.impl.BaseServicePlusImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tfjybj.itoo.exam.entity.StaffInstitutionEntity;
import com.tfjybj.itoo.exam.model.StaffInstitutionModel;
import com.tfjybj.itoo.exam.provider.dao.StaffInstitutionDao;
import com.tfjybj.itoo.exam.provider.service.StaffInstitutionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * StaffInstitutionService接口实现类
 * ${base}表
 *
 * @author 杨江涛
 * @version 2.0.0
 * @since 2.0.0 2018-11-15 10:35:56
 */
@Service("staffInstitutionService")
public class StaffInstitutionServiceImpl extends BaseServicePlusImpl<StaffInstitutionDao, StaffInstitutionEntity> implements StaffInstitutionService {
	
	//region 模板生成

    @Resource
    private StaffInstitutionDao staffInstitutionDao;

	 @Override
    public PageInfo<StaffInstitutionEntity> queryByLikeStaffId(String staffId, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(staffInstitutionDao.queryLikeStaffId(staffId));
    }


    //endregion

    /* **********************************以下为非模板生成的内容********************************* */

    @Override
    public List<StaffInstitutionEntity> findByStaffId(String staffId) {
        // todo 没有迁 因为有问题
        //TODO 方法有问题，暂时不动了
        return staffInstitutionDao.findByStaffId(staffId);



    }

    /**
     * 根据教师id查询所属机构
     *
     * @since 2018-12-9 12:00:34
     * @author maying
     * @param userId userId
     */
    @Override
    public List<StaffInstitutionModel> queryCollege(String userId) {
        return staffInstitutionDao.queryCollege(userId);
    }
}
